// Author: wsfuyibing <682805@qq.com>
// Date: 2025-06-11

package responses

import (
	"server/app/http/models"
	"server/app/kind"
)

// OrderPaiKindResponse
// 订单支付类型.
type OrderPaiKindResponse struct {
	Id          int64
	OrderId     int64
	PayKind     kind.PayKind
	PayKindText string
	Locked      kind.LockedState
	LockedText  string
	CanReset    bool
	Amount      kind.Balance
}

// With
// 数据绑定.
func (o *OrderPaiKindResponse) With(m *models.OrderPayKind) *OrderPaiKindResponse {
	o.Id = m.Id
	o.OrderId = m.OrderId
	o.PayKind = m.PayKind
	o.PayKindText = m.PayKind.Text()
	o.Locked = m.Locked
	o.LockedText = m.Locked.Text()
	o.CanReset = m.PayKind.CanReset()
	o.Amount = m.Amount
	return o
}
